<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div>
    <script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel">
        class InputElement extends React.Component{
            render(){
                return <div>
                        <label>{this.props.children}</label>
                        <input type={this.props.type} />
                    </div>
            }
        }
        class RadioElement extends React.Component{
            render(){
                return <div>
                        <label>{this.props.children}</label>
                        <input type="radio" name={this.props.name} value="男" /><label>男</label>
                        <input type="radio" name={this.props.name} value="女" /><label>女</label>
                    </div>
            }
        }
        class Add extends React.Component{
            render(){
                return <div>
                        <h2>增加学生</h2>
                        <InputElement>姓名：</InputElement>
                        <InputElement>年龄：</InputElement>
                        <RadioElement name="addGender">性别：</RadioElement>
                        <input type="button" value="增加" />
                    </div>
            }
        }
        class Update extends React.Component{
            render(){
                return <div>
                        <h2>修改学生</h2>
                        <InputElement>姓名：</InputElement>
                        <InputElement>年龄：</InputElement>
                        <RadioElement name="updateGender">性别：</RadioElement>
                        <input type="button" value="修改" />
                    </div>
            }
        }
        class Search extends React.Component{
            render(){
                return <div>
                        <select>
                            <option value="name">姓名</option> 
                            <option value="gender">性别</option> 
                            <option value="age">年龄</option>    
                        </select>
                        <input type="text" />
                        <input type="button" value="搜索" />
                    </div>
            }
        }
        class List extends React.Component{
            render(){
                return <table border="1">
                        <thead>
                            <tr>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>年龄</th>
                                <th>操作</th>
                            </tr>    
                        </thead>
                        <tbody>
                            <tr>
                                <td>张飞</td>
                                <td>男</td>
                                <td>20</td>
                                <td>
                                    <input type="button" value="修改" />
                                    <input type="button" value="删除" />
                                </td>
                            </tr>
                            
                            </tbody>
                    </table>
            }
        }
        class Student extends React.Component{
            render(){
                return (
                    <div>
                        <Add />  
                        <Update />    
                        <Search />    
                        <List />    
                    </div>
                )
            }
        }
        ReactDOM.render(<Student />,document.getElementById("root"));
    </script>
</body>
</html>